﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Galaktika.BI.Silverlight.Controls.PivotGrid.Controls
{
    public partial class PivotDataControl : UserControl
    {
        public readonly PivotGridPanel PivotGrid = null;
        public UpdateablePivotGridControl Owner = null;

        public PivotDataControl()
        {
            InitializeComponent();
            IsTabStop = false;

            PivotGrid = new PivotGridPanel(this);

            this.GotFocus += new RoutedEventHandler(SpanPivotGridControl_GotFocus);
            this.MouseLeftButtonDown += new MouseButtonEventHandler(SpanPivotGridControl_MouseLeftButtonDown);

            ScrollView.Content = PivotGrid;
        }

        void SpanPivotGridControl_GotFocus(object sender, RoutedEventArgs e)
        {
            if (e.OriginalSource is TextBox)
            {
            }
            else
            {
                PivotGrid.CellsControl.Focus();
            }
        }

        void SpanPivotGridControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            PivotGrid.CellsControl.Focus();
        }


    }
}
